Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lost focus when navigating back in project search result #22483

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

feeiyu
Copy link
Contributor

@feeiyu feeiyu commented Dec 29, 2024

Closes #22447

When navigate forward/back, the focus moves from the ProjectSearchView's result editor to the Pane, and then move to the ProjectSearchView, but the event on_focus_in not triggered for ProjectSearchView, causing the result editor to lose focus eventually.

pane.focus(cx);

pane.activate_item(index, true, true, cx);

Considering that the navigation might be triggered again in the next frame, so use on_next_frame in on_focus event to move focus to result editor.

Next frame:

  • the blur event triggered for result editor.
  • focus move from ProjectSearchView to result editor in on_focus event for ProjectSearchView
  • navigate again, focus moves from result editor to Pane then move back to ProjectSearchView
  • the focus not change during this frame, so no focus event happened for ProjectSearchView.

fix lost focus1229

Release Notes:

  • Fix lost focus when navigate back in project search result

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 29, 2024
@maxdeviant maxdeviant changed the title Fix lost focus when navigate back in project search result Fix lost focus when navigating back in project search result Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lost focus when navigate back in project search result
1 participant